package com.eco.fanliapp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.eco.fanliapp.dao.SyUserWxContrastMapper;
import com.eco.fanliapp.entity.SyUserWxContrast;
import com.eco.fanliapp.service.ISyUserWxContrastService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-08-08
 */
@Service
public class SyUserWxContrastServiceImpl extends ServiceImpl<SyUserWxContrastMapper, SyUserWxContrast> implements ISyUserWxContrastService {

    @Autowired
    private SyUserWxContrastMapper syUserWxContrastMapper;


    @Override
    public SyUserWxContrast selectByUserId(String wechatUnionid) {
        QueryWrapper<SyUserWxContrast> queryWrapper = new QueryWrapper();
        queryWrapper.eq("union_id", wechatUnionid);
        queryWrapper.eq("enable", 1);
        queryWrapper.eq("deleted", 0);
        return syUserWxContrastMapper.selectOne(queryWrapper);
    }
}
